From 33cde6585b79a644b20d1aa24aac51e9e28c02e4 Mon Sep 17 00:00:00 2001 From: "fred@xuni-t01.sc.intel.com" Date: Tue, 2 Aug 2005 02:47:41 -0800 Subject: [PATCH] Fix calling point for do_softirq, which should only be checked at the very point back to guest domain. Or else unexpected domain switch may happen in nested interrupt in Xen. Signed-off-by Kevin Tian --- xen/arch/ia64/patch/linux-2.6.11/irq_ia64.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xen/arch/ia64/patch/linux-2.6.11/irq_ia64.c b/xen/arch/ia64/patch/linux-2.6.11/irq_ia64.c index 51f8fe05cf..473db52b26 100644 --- a/xen/arch/ia64/patch/linux-2.6.11/irq_ia64.c +++ b/xen/arch/ia64/patch/linux-2.6.11/irq_ia64.c @@ -20,11 +20,19 @@ __do_IRQ(local_vector_to_irq(vector), regs); /* -@@ -167,6 +173,95 @@ +@@ -167,6 +173,103 @@ irq_exit(); } +#ifdef CONFIG_VTI ++#define vmx_irq_enter() \ ++ add_preempt_count(HARDIRQ_OFFSET); ++ ++/* Now softirq will be checked when leaving hypervisor, or else ++ * scheduler irq will be executed too early. ++ */ ++#define vmx_irq_exit(void) \ ++ sub_preempt_count(HARDIRQ_OFFSET); +/* + * That's where the IVT branches when we get an external + * interrupt. This branches to the correct hardware IRQ handler via @@ -72,7 +80,7 @@ + * 16 (without this, it would be ~240, which could easily lead + * to kernel stack overflows). + */ -+ irq_enter(); ++ vmx_irq_enter(); + saved_tpr = ia64_getreg(_IA64_REG_CR_TPR); + ia64_srlz_d(); + while (vector != IA64_SPURIOUS_INT_VECTOR) { @@ -106,7 +114,7 @@ + * handler needs to be able to wait for further keyboard interrupts, which can't + * come through until ia64_eoi() has been done. + */ -+ irq_exit(); ++ vmx_irq_exit(); + if ( wake_dom0 && current != dom0 ) + domain_wake(dom0->vcpu[0]); +} -- 2.30.2